# *-* coding:utf8 *-*
import redis
import logging


class Config(object):
    '''配置信息'''
    SECRET_KEY = 'ajfahsjfhaskjfkajskjfkajskjfkla;slkfs;'

    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql://heima:mysql@127.0.0.1:3306/infotion'
    SQLALCHEMY_TRACK_MODIFICATIONS = True

    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 8080

    # session保存内容
    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True
    SECRET_REDIS = redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    LOG_LEVEL = logging.DEBUG



class DevelopementConfig(Config):
    """开发模式下的配置"""
    DEBUG = True


class PraoductionConfig(Config):
    """生产模式下的配置"""
    LOG_LEVEL = logging.ERROR


# 工厂模式
config = {
    'developementxonfig':DevelopementConfig,
    'productionconfig':PraoductionConfig
}